import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
  server: {
    open: true,
    port: 3001,
    https: false,
    proxy: {
      "/models": {
        target: "http://172.16.251.126:3000",
        changeOrigin: true,
        secure: false,
      },
    },
  },
  build: {
    terserOptions: {
      compress: {
        // 去除开发模式下的console
        drop_console: true,
        drop_debugger: true,
      },
    },
  },
  css: {
    preprocessorOptions: {
      less: {
        javascriptEnabled: true,
      },
    },
  },
});
